﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Platform
{
    /// <summary>
    /// OAuth2 参数名
    /// </summary>
    public static class OpenAuthKey
    {
        #region OAuth2 参数名称
        /// <summary>
        /// 
        /// </summary>
        public const string PASSPORT_TOKEN = @"passport_token";
        /// <summary>
        /// 
        /// </summary>
        public const string AUTH_TICKET = @"auth_ticket";
        /// <summary>
        /// 接入的应用ID
        /// </summary>
        public const string AUTH_APP_ID = @"app_id";
        /// <summary>
        /// 接入的应用安全密钥
        /// </summary>
        public const string AUTH_SECRET_KEY = @"secret_key";
        /// <summary>
        /// 授权码
        /// </summary>
        public const string AUTH_CODE = @"auth_code";
        /// <summary>
        /// 访问令牌
        /// </summary>
        public const string AUTH_ACCESS_TOKEN = @"access_token";
        /// <summary>
        /// 刷新令牌
        /// </summary>
        public const string AUTH_REFRESH_TOKEN = @"refresh_token";
        /// <summary>
        /// 授权类型
        /// </summary>
        public const string AUTH_GRANT_TYPE = @"grant_type";
        /// <summary>
        /// 
        /// </summary>
        public const string AUTH_RESPONSE_TYPE = @"response_type";
        /// <summary>
        /// 用于保存返回URI地址的键名
        /// </summary>
        public const string AUTH_REDIRECT_URI = @"redirect_uri";
        /// <summary>
        /// 接入方上下文
        /// </summary>
        public const string AUTH_CLIENT_CONTEXT = @"client_context";
        /// <summary>
        /// 授权范围
        /// </summary>
        public const string AUTH_SCOPE = @"scope";
        /// <summary>
        /// 
        /// </summary>
        public const string AUTH_SCHEME = @"Bearer";
        #endregion

    }

    /// <summary>
    /// 
    /// </summary>
    public enum AuthResponseType
    {
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("authCode")]
        AuthCode,
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("implicit")]
        Implicit,
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("clientCredentials")]
        ClientCredentials,
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("pwdCredentials")]
        PwdCredentials
    }

    /// <summary>
    /// 
    /// </summary>
    public enum AuthScope
    {
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("simple")]
        Simple,
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("standard")]
        Standard,
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("advanced")]
        Advanced
    }

    /// <summary>
    /// 
    /// </summary>
    public enum AuthGrantType
    {
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("authorization_code")]
        AuthorizationCode,
        /// <summary>
        /// 刷新access token
        /// </summary>
        [JsonProperty("refresh_token")]
        RefreshToken,
        /// <summary>
        /// 提取access token
        /// </summary>
        [JsonProperty("get_token")]
        GetToken
    }
}
